import React from 'react'
import ReactDOM from 'react-dom/client'

// 1. 创建react元素
const list = [
  { id: 1, name: '上海黑马88期', salary: 15000 },
  { id: 2, name: '上海黑马89期', salary: 16000 },
  { id: 3, name: '上海黑马90期', salary: 17000 },
]

const el = (
  <>
    <h1>列表渲染</h1>
    <hr />

    <ul>
      {list.map((item) => (
        <li key={item.id}>{item.name}</li>
      ))}
    </ul>
  </>
)

// 创建挂载点
const root = ReactDOM.createRoot(document.getElementById('root'))

root.render(el)
